void route_disp(const route_head* rte, std::nullptr_t /* waypt_cb */); /* override to catch nullptr */
//void route_disp_all(route_hdr, route_trl, waypt_cb); /* template */
//void track_disp_all(route_hdr, route_trl, waypt_cb); /* template */
-void route_reverse(const route_head* rte_hd);
void route_disp_session(const session_t* se, route_hdr rh, route_trl rt, waypt_cb wc);
void track_disp_session(const session_t* se, route_hdr rh, route_trl rt, waypt_cb wc);
void route_flush_all_routes();
/* Tracklog styles */
// TODO: The format document states there are ts_count tracklog style entries,
// and tr_count tracklog entries.
- // Some tracklog entries may be contiuation entries, so we turn these into
- // real_track_list.size() <= tr_count tracks.
- // If ts_count != real_track_list.size() we don't know how to line up the tracklogs,
- // and the real tracks, with the tracklog styles.
+ // Some tracklog entries may be continuation entries, so we turn these
+ // into real_track_list.size() <= tr_count tracks.
+ // If ts_count != real_track_list.size() we don't know how to line up
+ // the tracklogs, and the real tracks, with the tracklog styles.
if (ts_count != real_track_list.size()) {
- warning(MYNAME ": The number of tracklog entries with the new flag set doesn't match the number of tracklog style entries.");
+ warning(MYNAME ": The number of tracklog entries with the new flag "
+ "set doesn't match the number of tracklog style entries.\n"
+ " This is unexpected and may indicate a malformed input file.\n"
+ " As a result the track names may be incorrect.\n");
}
+ // Read the entire tracklog styles section whether we use it or not.
for (i = 0; i != ts_count; i++) {
QString tname = fread_string(file_in);
fread_discard(file_in, 12);
const char* fvec_opts = nullptr;
int opt_version = 0;
bool did_something = false;
- queue* wpt_head_bak; /* #ifdef UTF8_SUPPORT */
- RouteList* rte_head_bak, *trk_head_bak; /* #ifdef UTF8_SUPPORT */
- signed int wpt_ct_bak; /* #ifdef UTF8_SUPPORT */
- bool lists_backedup; /* #ifdef UTF8_SUPPORT */
+ queue* wpt_head_bak;
+ RouteList* rte_head_bak, *trk_head_bak;
+ signed int wpt_ct_bak;
+ bool lists_backedup;
QStack<QargStackElement> qargs_stack;
// Use QCoreApplication::arguments() to process the command line.
prev_new_trkseg = curr_new_trkseg;
}
-void ReverseRouteFilter::reverse_route_head(const route_head* rte)
+void ReverseRouteFilter::reverse_route_head(const route_head* rte_hd)
{
- route_reverse(rte);
+ /* Cast away const-ness */
+ auto rh = const_cast<route_head*>(rte_hd);
+ queue* elem, *tmp;
+ QUEUE_FOR_EACH(&rh->waypoint_list, elem, tmp) {
+ ENQUEUE_HEAD(&rh->waypoint_list, dequeue(elem));
+ }
prev_new_trkseg = 1;
}
// wc == nullptr
}
-void
-route_reverse(const route_head* rte_hd)
-{
- /* Cast away const-ness */
- auto rh = const_cast<route_head*>(rte_hd);
- queue* elem, *tmp;
- QUEUE_FOR_EACH(&rh->waypoint_list, elem, tmp) {
- ENQUEUE_HEAD(&rh->waypoint_list, dequeue(elem));
- }
-}
-
void
route_disp_session(const session_t* se, route_hdr rh, route_trl rt, waypt_cb wc)
{
rte->rte_waypt_ct++; /* waypoints in this route */
++waypt_ct;
if (synth && wpt->shortname.isEmpty()) {
- wpt->shortname = QString().sprintf("%s%0*d", CSTRc(namepart), number_digits, waypt_ct);
+ wpt->shortname = QString("%1%2").arg(namepart).arg(waypt_ct, number_digits, 10, QChar('0'));
wpt->wpt_flags.shortname_is_synthetic = 1;
}
update_common_traits(wpt);